The Hershey library is a set of C routines (with a FORTRAN interface) for drawing the Hershey font data with programs written with SGI-GL or the VOGL library. As Hershey characters are defined by a set of vectors, they are subject to the current transformation matrix and any line attributes that have been set. There are also facilities for sizing and rotating the characters in the library itself.
The character data and the fonts supplied are based on the character set digitized by Dr Allen V. Hershey while working at the U. S. National Bureau of Standards.
It should be noted that text is drawn parallel to the (x, y) plane using whatever the current Z coordinate is.
These routines change the current graphics position, that is they draw the characters (or string) at the current graphics position by using relative move/draw sequences.
The library also supports the shortened 6 character names for the FORTRAN interface. (Except for the routines hgetfontheight and hgetfontwidth which have shortend 6 character names of hgetfh and hgetfw respectively.
hfont(fontname) Set the current font
Fortran: subroutine hfont(fontname, len) character*(*) fontname integer len C: hfont(fontname) char *fontname There following names are available in this library. astrology cursive cyrillic futura.l futura.m gothic.eng gothic.ger gothic.ita greek markers math.low math.upp meteorology music script symbolic times.g times.i times.ib times.r times.rb japaneseA markers font "markers" is also provided for doing markers - you need to have centertext on for this to give sensible results - with the markers starting at 'A' and 'a'.
If the 'fontpath' has been set with hsetpath (see below) then hfont looks for the software fonts in the directory given. Otherwise, if the environment variable "HFONTLIB" is set hfont looks for the software fonts in the directory given by this value. To maintain compatiblity with VOGL and VOGLE, the envirionment variable "VFONTLIB" may be set similarly to HFONTLIB.
hsetpath(fontpath)
Fortran: subroutine hsetpath(fontpath, len) character*(*) fontpath integer len C: hsetpath(fontpath) char *fontpath
Fortran: subroutine htextsize(width, height) real width, height C: htextsize(width, height) float width, height;
Fortran: subroutine hboxfit(l, h, nchars) real l, h integer nchars C: hboxfit(l, h, nchars) float l, h int nchars
Fortran: subroutine htextang(ang) real ang C: htextang(ang) float ang;
Fortran: subroutine hfixedwidth(onoff) logical onoff C: hfixedwidth(onoff) int onoff;
Fortran: subroutine hcentertext(onoff) logical onoff C: hcentertext(onoff) int onoff;
Fortran: subroutine hrightjustify(onoff) logical onoff C: hrightjustify(onoff) int onoff;
Fortran: subroutine hleftjustify(onoff) logical onoff C: hleftjustify(onoff) int onoff;
Fortran: subroutine hgetcharsize(c, width, height) character*1 c real width, height C: hgetcharsize(c, width, height) char c; float *width, *height;
Fortran: subroutine hgetfs(width, height) real width, height subroutine hgetfontsize(width, height) real width, height C: hgetfontsize(width, height) float *width, *height;
Fortran: real function getdescender() C: float getdescender();
Fortran: real function getascender() C: float getascender();
Fortran: real function hstrlength(str, len) character*(*) str integer len C: float hstrlength(str) char *str;
Fortran: subroutine hdrawchar(c) character c C: hdrawchar(str) char c;
Fortran: subroutine hcharstr(str, len) character*(*) str integer len C: hcharstr(str) char *str;
Fortran: subroutine hboxtext(x, y, l, h, s, length) real x, y, l, h, s character*(*) s integer length C: hboxtext(x, y, l, h, s) float x, y, l, h; char *s;
We had to make up the font names based on some books of type faces.